<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>河套灌区农业面源污染决策支持系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
        }

        body {
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
        }

        /* 头部容器 */
        .header-container {
            background-color: rgb(0,135,60);
            color: white;
            padding: 15px 20px;
            display: flex;
            align-items: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            position: relative;
        }

        /* 标题容器 */
        .title-container {
            flex: 1;
            text-align: center;
        }

        /* 中文标题 */
        .chinese-title {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 5px;
            letter-spacing: 2px;
        }

        /* 英文标题 */
        .english-title {
            font-size: 16px;
            letter-spacing: 1px;
        }

        /* 用户信息区域 */
        .user-info {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
        }

        button {
            font-size: 14px;
            padding: 5px 10px;
            border: 1px solid white;
            border-radius: 3px;
            background: transparent;
            color: white;
            cursor: pointer;
        }

        button:hover {
            background-color: rgba(255,255,255,0.2);
        }

        .container {
            max-width: 95%;
            margin: 0 auto;
            padding: 0 15px;
        }

        /* 导航栏 */
        .navbar {
            background-color: #1a5f1a;
            padding: 10px 0;
        }

        .nav-menu {
            display: flex;
            justify-content: center;
            list-style: none;
            flex-wrap: wrap;
        }

        .nav-menu li {
            margin: 0 15px;
        }

        .nav-menu a {
            color: #fff;
            text-decoration: none;
            font-size: 16px;
            padding: 5px 10px;
            transition: all 0.3s;
        }

        .nav-menu a:hover {
            background-color: #0e4a0e;
            border-radius: 3px;
        }

        /* 主要内容 */
        .main-content {
            display: flex;
            width: 100%;
            margin: 15px 0;
        }

        .sidebar {
            width: 200px;
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            margin-right: 30px;
            flex: none;
        }

        .sidebar-title {
            font-size: 18px;
            color: rgb(0,135,60);
            padding-bottom: 10px;
            border-bottom: 1px solid #e0e0e0;
            margin-bottom: 15px;
        }

        .sidebar-menu {
            list-style: none;
        }

        .sidebar-menu li {
            margin-bottom: 10px;
        }

        .sidebar-menu a {
            color: #333;
            text-decoration: none;
            display: block;
            padding: 8px 5px;
            transition: all 0.3s;
        }

        .sidebar-menu a:hover {
            color: #1a5f1a;
            background-color: #f0f0f0;
            border-radius: 3px;
        }

        .content {
            flex: 5;
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .content-title {
            font-size: 22px;
            color: #1a5f1a;
            padding-bottom: 15px;
            border-bottom: 1px solid #e0e0e0;
            margin-bottom: 20px;
        }

        /* 页脚 */
        .footer {
            text-align: center;
            width: 100%;
            background-color: #1a5f1a;
            padding: 20px 0;
            border-top: 1px solid #e9ecef;
            color: #fff;
            margin-top: 30px;
        }

        /* 农业面源污染负荷计算器样式 - 优化版 */
        .calculator-container {
            max-width: 1200px;
            margin: 20px auto;
            background: white;
            padding: 25px;
            border-radius: 12px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        .calculator-header {
            text-align: center;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 2px solid #4CAF50;
        }

        .calculator-header h1 {
            color: #2c3e50;
            font-size: 28px;
            margin-bottom: 8px;
        }

        .calculator-header p {
            color: #7f8c8d;
            font-size: 16px;
        }

        .calculator-form {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .form-section {
            margin-bottom: 20px;
            padding: 15px;
            background: #f9f9f9;
            border-radius: 10px;
        }

        .section-title {
            font-size: 18px;
            color: #2c3e50;
            margin-bottom: 15px;
            padding-bottom: 8px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
        }

        .section-title i {
            margin-right: 10px;
            color: #4CAF50;
        }

        .form-group {
            margin-bottom: 15px;
            display: flex;
            flex-direction: column;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        label {
            margin-bottom: 8px;
            font-weight: 600;
            color: #34495e;
            display: flex;
            align-items: center;
        }

        label i {
            margin-right: 8px;
            color: #4CAF50;
            width: 20px;
        }

        input, select {
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 16px;
            transition: all 0.3s;
        }

        input:focus, select:focus {
            border-color: #4CAF50;
            outline: none;
            box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
        }

        /* 肥料输入区域样式 */
        .fertilizer-section {
            grid-column: 1 / span 2;
        }

        .fertilizer-inputs {
            margin-bottom: 15px;
            border: 1px solid #e0e0e0;
            padding: 15px;
            border-radius: 8px;
            background-color: #f9f9f9;
        }

        .fertilizer-item {
            display: grid;
            grid-template-columns: 1.5fr 1fr 0.5fr;
            gap: 12px;
            margin-bottom: 12px;
            align-items: center;
        }

        .remove-fertilizer {
            background-color: #e74c3c;
            color: white;
            border: none;
            border-radius: 5px;
            padding: 10px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .remove-fertilizer i {
            margin-right: 5px;
        }

        .add-fertilizer {
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 5px;
            padding: 10px 15px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            font-size: 14px;
        }

        .add-fertilizer i {
            margin-right: 8px;
        }

        /* 按钮样式 */
        .calculate-btn {
            background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
            color: white;
            border: none;
            padding: 14px;
            font-size: 16px;
            border-radius: 6px;
            cursor: pointer;
            width: 100%;
            font-weight: 600;
            transition: all 0.3s;
            margin-top: 15px;
            grid-column: 1 / span 2;
        }

        .calculate-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        }

        /* 结果区域样式 */
        #results {
            margin-top: 25px;
            padding-top: 15px;
            border-top: 1px solid #eee;
            grid-column: 1 / span 2;
        }

        .hidden {
            display: none;
        }

        .loading {
            text-align: center;
            padding: 20px;
            font-style: italic;
            color: #7f8c8d;
            font-size: 16px;
        }

        .loading i {
            margin-right: 10px;
            animation: spin 1s infinite linear;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .calculation-results {
            margin-top: 15px;
            padding: 20px;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 8px;
            border-left: 5px solid #3498db;
        }

        .result-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .result-card {
            background: white;
            padding: 15px;
            border-radius: 6px;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
        }

        .result-card h3 {
            color: #2c3e50;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #eee;
        }

        .result-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px dashed #eee;
        }

        .result-item:last-child {
            border-bottom: none;
        }

        .result-label {
            font-weight: bold;
            color: #2c3e50;
        }

        .result-value {
            color: #4CAF50;
            font-weight: 600;
        }

        .highlight {
            background-color: #ffeaa7;
            padding: 3px 6px;
            border-radius: 4px;
            font-weight: bold;
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .calculator-form {
                grid-template-columns: 1fr;
            }
            
            .fertilizer-section {
                grid-column: 1;
            }
            
            .calculate-btn {
                grid-column: 1;
            }
            
            #results {
                grid-column: 1;
            }
        }

        @media (max-width: 768px) {
            .form-row {
                grid-template-columns: 1fr;
            }
            
            .fertilizer-item {
                grid-template-columns: 1fr;
            }
            
            .result-grid {
                grid-template-columns: 1fr;
            }
            
            .container {
                padding: 15px;
            }
            
            .main-content {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                margin-right: 0;
                margin-bottom: 20px;
            }
        }

        .calculator-footer {
            text-align: center;
            margin-top: 20px;
            color: #7f8c8d;
            font-size: 14px;
            grid-column: 1 / span 2;
        }
    </style>
</head>
<body>
    <!-- 头部区域 -->
    <div class="header-container">
        <!-- 校徽 -->
        <img src="../images/footer_logo.png"
             width="190px"
             height="60px"
             class="xiaohui">
        <!-- 标题 -->
        <div class="title-container">
            <div class="chinese-title">河套灌区农业面源污染决策支持系统</div>
            <div class="english-title">Decision Support System for Agricultural Non-Point Source Pollution in the Hetao Irrigation District</div>
        </div>
        
        <!-- 用户信息 -->
        <div class="user-info">
            <span class="welcome">用户您好</span>
            <button type="button" onclick="window.location.href='封面.html'">退出登录</button>
        </div>
    </div>
    
    <!-- 导航栏 -->
    <nav class="navbar">
        <div class="container">
            <ul class="nav-menu">
                <li><a href="#" onclick="window.location.href='../首页.html'">首页</a></li>
                <li><a href="#" onclick="window.location.href='weather.html'">属性数据</a></li>
                <li><a href="#" onclick="window.location.href='包气带介质类型.html'">空间数据</a></li>
                <li><a href="#" onclick="window.location.href='案例.html'">模型库</a></li>
                <li><a href="#" onclick="window.location.href='地表水环境质量标准.html'">知识库</a></li>
                <li><a href="#" onclick="window.location.href='相关网站.html'">相关网站</a></li>
            </ul>
        </div>
    </nav>
  
    <!-- 主要内容 -->
    <div class="container">
        <div class="main-content">
            <!-- 侧边栏 -->
            <aside class="sidebar">
                <h3 class="sidebar-title">模型库</h3>
                <ul class="sidebar-menu">
                    <li><a href="#" onclick="window.location.href='案例.html'">案例</a></li>
                    <li><a href="#" class="active" onclick="window.location.href='模拟.html'">模拟</a></li>
                    <li><a href="#" onclick="window.location.href='河套灌区农业面源污染负荷.html'">河套灌区农业面源污染负荷</a></li>
                </ul>
            </aside>
            
            <!-- 主要内容区 -->
            <main class="content">
                <h2 class="content-title">农业面源污染负荷计算</h2>
                
                <!-- 农业面源污染负荷计算器 - 优化版 -->
                <div class="calculator-container">
                    <div class="calculator-header">
                        <h1>农业面源污染负荷计算器</h1>
                        <p>根据肥料用量和环境参数计算农田污染负荷</p>
                    </div>
                    
                    <form id="fertilizer-form">
                        <div class="calculator-form">
                            <div class="form-section">
                                <div class="section-title">
                                    <i class="fas fa-leaf"></i>作物信息
                                </div>
                                
                                <div class="form-group">
                                    <label for="cropType">
                                        <i class="fas fa-seedling"></i>作物类型：
                                    </label>
                                    <select id="cropType" required>
                                        <option value="">选择作物类型</option>
                                        <option value="wheat">小麦</option>
                                        <option value="corn">玉米</option>
                                        <option value="rice">水稻</option>
                                        <option value="cotton">棉花</option>
                                        <option value="vegetable">蔬菜</option>
                                        <option value="other">其他</option>
                                    </select>
                                </div>
                                
                                <div class="form-group">
                                    <label for="cropArea">
                                        <i class="fas fa-ruler-combined"></i>种植面积(公顷)：
                                    </label>
                                    <input type="number" id="cropArea" step="0.01" min="0.01" value="0.04" required>
                                </div>
                            </div>
                            
                            <div class="form-section">
                                <div class="section-title">
                                    <i class="fas fa-map-marker-alt"></i>地理位置
                                </div>
                                
                                <div class="form-group">
                                    <label for="location">
                                        <i class="fas fa-location-dot"></i>坐标经纬度：
                                    </label>
                                    <div class="form-row">
                                        <input type="text" id="latitude" placeholder="纬度" value="40.7128° N" required>
                                        <input type="text" id="longitude" placeholder="经度" value="74.0060° W" required>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-section fertilizer-section">
                                <div class="section-title">
                                    <i class="fas fa-flask"></i>肥料信息
                                </div>
                                
                                <div class="fertilizer-inputs">
                                    <div class="fertilizer-item">
                                        <select name="fertilizerName" required>
                                            <option value="">选择肥料类型</option>
                                            <option value="urea">尿素</option>
                                            <option value="ammoniumNitrate">硝酸铵</option>
                                            <option value="superphosphate">过磷酸钙</option>
                                            <option value="compound">复合肥</option>
                                            <option value="P2O5">磷酸二铵</option>
                                            <option value="organic">有机肥</option>
                                        </select>
                                        <input type="number" name="fertilizerAmount" placeholder="施肥量 (kg/公顷)" step="0.1" min="0" required>
                                        <button type="button" class="remove-fertilizer">
                                            <i class="fas fa-trash"></i>删除
                                        </button>
                                    </div>
                                </div>
                                
                                <button type="button" class="add-fertilizer">
                                    <i class="fas fa-plus"></i>添加另一种肥料
                                </button>
                            </div>
                            
                            <div class="form-section">
                                <div class="section-title">
                                    <i class="fas fa-temperature-high"></i>气候参数
                                </div>
                                
                                <div class="form-group">
                                    <label for="temperature">
                                        <i class="fas fa-thermometer-half"></i>气温(℃)：
                                    </label>
                                    <input type="number" id="temperature" step="0.1" value="20" required>
                                </div>
                            </div>
                            
                            <div class="form-section">
                                <div class="section-title">
                                    <i class="fas fa-mountain"></i>土壤参数
                                </div>
                                
                                <div class="form-group">
                                    <label for="soilSilt">
                                        <i class="fas fa-tint"></i>土壤粉粒含量(%)：
                                    </label>
                                    <input type="number" id="soilSilt" step="0.1" value="40" required>
                                </div>
                                
                                <div class="form-group">
                                    <label for="soilSand">
                                        <i class="fas fa-tint"></i>土壤砂粒含量(%)：
                                    </label>
                                    <input type="number" id="soilSand" step="0.1" value="30" required>
                                </div>

                                <div class="form-group">
                                    <label for="soilClay">
                                        <i class="fas fa-tint"></i>土壤黏粒含量(%)：
                                    </label>
                                    <input type="number" id="soilClay" step="0.1" value="30" required>
                                </div>
                                
                                <div class="form-group">
                                    <label for="soilOrganic">
                                        <i class="fas fa-leaf"></i>土壤有机质含量(g/kg)：
                                    </label>
                                    <input type="number" id="soilOrganic" step="0.01" value="2.5" required>
                                </div>
                            </div>
                        </div>
                        
                        <button type="submit" class="calculate-btn">
                            <i class="fas fa-calculator"></i>开始计算
                        </button>
                    </form>
                    
                    <div id="results" class="hidden">
                        <div class="section-title">
                            <i class="fas fa-chart-line"></i>计算结果
                        </div>
                        <div id="loading" class="loading">
                            <i class="fas fa-spinner"></i>计算中，请稍候...
                        </div>
                        <div id="result-content" class="calculation-results hidden">
                            <!-- 结果将通过JavaScript动态生成 -->
                        </div>
                    </div>
                    
                    <div class="calculator-footer">
                        <p>© 2025 河套灌区农业面源污染决策支持系统 | 基于科学模型的污染负荷计算工具</p>
                    </div>
                </div>
            </main>
        </div>
    </div>
      
    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <p>© 2025 河套灌区农业面源污染决策支持系统 版权所有</p>
        </div>
    </footer>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js"></script>
    <script>
        // 肥料数据库 - 包含常见肥料的氮磷含量（单位：%）
        const fertilizerDatabase = {
            urea: { name: "尿素", nitrogen: 46, phosphorus: 0 },
            ammoniumNitrate: { name: "硝酸铵", nitrogen: 34, phosphorus: 0 },
            superphosphate: { name: "过磷酸钙", nitrogen: 0, phosphorus: 16 },
            compound: { name: "复合肥", nitrogen: 15, phosphorus: 15 },
            P2O5: { name: "磷酸二铵", nitrogen: 18, phosphorus: 46 },
            organic: { name: "有机肥", nitrogen: 2, phosphorus: 1 }
        };

        // 添加肥料输入行
        document.querySelector('.add-fertilizer').addEventListener('click', function() {
            const fertilizerInputs = document.querySelector('.fertilizer-inputs');
            const newFertilizerItem = document.querySelector('.fertilizer-item').cloneNode(true);
            
            // 清空输入
            newFertilizerItem.querySelector('select').selectedIndex = 0;
            newFertilizerItem.querySelector('input').value = '';
            
            // 显示删除按钮
            newFertilizerItem.querySelector('.remove-fertilizer').style.display = 'flex';
            
            // 添加删除功能
            newFertilizerItem.querySelector('.remove-fertilizer').addEventListener('click', function() {
                this.parentElement.remove();
            });
            
            fertilizerInputs.appendChild(newFertilizerItem);
        });

        // 表单提交处理
        document.getElementById('fertilizer-form').addEventListener('submit', function(e) {
            e.preventDefault();
            
            // 显示加载状态
            document.getElementById('results').classList.remove('hidden');
            document.getElementById('loading').classList.remove('hidden');
            document.getElementById('result-content').classList.add('hidden');
            
            // 模拟计算过程
            setTimeout(calculatePollutionLoad, 1500);
        });

        // 污染负荷计算函数
        function calculatePollutionLoad() {
            // 获取作物信息
            const cropType = document.getElementById('cropType');
            const cropTypeName = cropType.options[cropType.selectedIndex].text;
            const cropArea = parseFloat(document.getElementById('cropArea').value);
            
            // 获取地理位置
            const latitude = document.getElementById('latitude').value;
            const longitude = document.getElementById('longitude').value;
            
            // 获取所有肥料输入
            const fertilizerItems = document.querySelectorAll('.fertilizer-item');
            let totalNitrogen = 0;
            let totalPhosphorus = 0;
            let fertilizerDetails = [];
            
            // 计算每种肥料提供的氮磷量
            fertilizerItems.forEach(item => {
                const fertilizerType = item.querySelector('select').value;
                const fertilizerAmount = parseFloat(item.querySelector('input').value);
                
                if (fertilizerType && !isNaN(fertilizerAmount)) {
                    const fertilizer = fertilizerDatabase[fertilizerType];
                    const nitrogenContent = (fertilizerAmount * fertilizer.nitrogen) / 100;
                    const phosphorusContent = (fertilizerAmount * fertilizer.phosphorus) / 100;
                    
                    totalNitrogen += nitrogenContent;
                    totalPhosphorus += phosphorusContent;
                    
                    fertilizerDetails.push({
                        name: fertilizer.name,
                        amount: fertilizerAmount,
                        nitrogen: nitrogenContent,
                        phosphorus: phosphorusContent
                    });
                }
            });
            
            // 获取其他环境参数
            const temperature = parseFloat(document.getElementById('temperature').value);
            const soilSilt = parseFloat(document.getElementById('soilSilt').value);
            const soilSand = parseFloat(document.getElementById('soilSand').value);
            const soilClay = parseFloat(document.getElementById('soilClay').value);
            const soilOrganic = parseFloat(document.getElementById('soilOrganic').value);
            
            // 计算污染负荷（这里使用简化公式，实际应用可能需要更复杂的模型）
            // 假设污染负荷 = (氮/磷总量) * 环境因子系数 * 面积
            TN = 0.4854;
            TP =0.201;
            const nitrogenLoad = totalNitrogen * TN * cropArea;
            const phosphorusLoad = totalPhosphorus * TP * cropArea;
            
            // 隐藏加载指示器
            document.getElementById('loading').classList.add('hidden'); 
            document.getElementById('result-content').classList.remove('hidden');
            
            // 显示结果
            const resultContent = document.getElementById('result-content');
            
            // 显示基本信息
            resultContent.innerHTML = `
                <div class="result-grid">
                    <div class="result-card">
                        <h3><i class="fas fa-info-circle"></i> 基本信息</h3>
                        <div class="result-item">
                            <span class="result-label">作物类型:</span>
                            <span class="result-value">${cropTypeName}</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">种植面积:</span>
                            <span class="result-value">${cropArea} 公顷</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">地理位置:</span>
                            <span class="result-value">${latitude}, ${longitude}</span>
                        </div>
                    </div>
                    
                    <div class="result-card">
                        <h3><i class="fas fa-calculator"></i> 环境参数</h3>
                        <div class="result-item">
                            <span class="result-label">气温:</span>
                            <span class="result-value">${temperature} ℃</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">土壤质地:</span>
                            <span class="result-value">粉粒${soilSilt}% 砂粒${soilSand}% 黏粒${soilClay}%</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">有机质含量:</span>
                            <span class="result-value">${soilOrganic} g/kg</span>
                        </div>
                    </div>
                </div>
                
                <h3 style="margin: 20px 0 12px;"><i class="fas fa-flask"></i> 农业面源污染负荷</h3>
            `;
            
            // 显示肥料详情
            fertilizerDetails.forEach(fertilizer => {
                resultContent.innerHTML += `
                    <div class="result-item">
                        <span class="result-label">${fertilizer.name} (${fertilizer.amount} kg/公顷):</span>
                        <span class="result-value">氮: ${fertilizer.nitrogen.toFixed(2)} kg, 磷: ${fertilizer.phosphorus.toFixed(2)} kg</span>
                    </div>
                `;
            });
            
            // 显示总计和污染负荷
            resultContent.innerHTML += `
                <div class="result-grid" style="margin-top: 15px;">
                    <div class="result-card">
                        <h3><i class="fas fa-exclamation-triangle"></i> 污染负荷估算</h3>
                        <div class="result-item">
                            <span class="result-label">总氮输入:</span>
                            <span class="result-value">${totalNitrogen.toFixed(2)} kg/公顷</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">总磷输入:</span>
                            <span class="result-value">${totalPhosphorus.toFixed(2)} kg/公顷</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">环境因子系数:</span>
                            <span class="result-value">${envFactor.toFixed(3)}</span>
                        </div>
                    </div>
                    
                    <div class="result-card">
                        <h3><i class="fas fa-chart-bar"></i> 最终结果</h3>
                        <div class="result-item">
                            <span class="result-label">估算氮污染负荷:</span>
                            <span class="result-value highlight">${nitrogenLoad.toFixed(2)} kg</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">估算磷污染负荷:</span>
                            <span class="result-value highlight">${phosphorusLoad.toFixed(2)} kg</span>
                        </div>
                        <div class="result-item">
                            <span class="result-label">评估结果:</span>
                            <span class="result-value">${nitrogenLoad < 100 ? '低污染风险' : '高污染风险'}</span>
                        </div>
                    </div>
                </div>
            `;
        }
        
        // 初始化页面
        document.addEventListener('DOMContentLoaded', function() {
            // 隐藏第一个删除按钮
            document.querySelector('.remove-fertilizer').style.display = 'none';
        });
    </script>
</body>
</html>